<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>robot deferred connect tests</title>

	<style>
		@import "../../../util/doh/robot/robot.css";
	</style>

	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../../dojo/dojo.js"
		data-dojo-config="isDebug: true, async: true"></script>

	<script type="text/javascript">
		require([
			"doh/runner", "dojo/robotx", "dojo/domReady!"
		], function(doh, robot){
			robot.initRobot('../_Widget-deferredConnect.html');

			// Test that deferred connections get set up correctly when they need to be
			// (_Widget only does the dojo.connect() for onmousemove if it needs to)
			doh.register("deferredConnect", [
				{
					name: "mouse move on widget where onmousemove overridden",
					timeout: 5000,
					runTest: function(){
						var d = new doh.Deferred();
						robot.mouseMoveAt("overrode", 500);
						robot.sequence(d.getTestCallback(function(){
							doh.t(robot.window.overrodeMouseMoved, "overrode button event handler fired");
						}), 500);
						return d;
					}
				},
				{
					name: "mouse move on widget where onmousemove connected",
					timeout: 5000,
					runTest: function(){
						var d = new doh.Deferred();
						robot.mouseMoveAt("connect", 500);

						robot.sequence(d.getTestCallback(function(){
							doh.t(robot.window.connectedMouseMoved, "connected button event handler fired");
						}), 500);
						return d;
					}
				},
				{
					name: "mouse move on widget where onmousemove overridden and connected",
					timeout: 5000,
					runTest: function(){
						var d = new doh.Deferred();
						robot.mouseMoveAt("both", 500);

						robot.sequence(d.getTestCallback(function(){
							doh.t(robot.window.bothOverrodeMouseMoved, "dojo/method handler fired");
							doh.t(robot.window.bothConnectedMouseMoved, "dojo/connect handler fired");
						}), 500);
						return d;
					}
				}
			]);

			doh.run();
		});
	</script>
</head>
</html>
